export const mapStateToProps = (state: any) => {
    return {
        num: state.home.num,
        username: state.kind.username
    }
}
// mapDispatchToProps 函数，默认参数为dispatch，必须含有返回值，返回的值就是App组件需要使用的业务逻辑
export const mapDispatchToProps = (dispatch: any) => {
    return {
        addNum() {
            dispatch({
                type: 'ADD',
                payload: undefined
            })
        },
        mudNum() {
            dispatch({
                type: 'MUD',
                payload: undefined
            })
        },
        changeUsername(username: any) {
            dispatch({
                type: 'CHANGE_NAME',
                payload: {
                    username: "前端老兵 - 参数修改" + username
                }
            })

        }
    }
}